home *** CD-ROM | disk | FTP | other *** search
/ Products & Services for NeXT / Products & Services for NeXT.iso / AlembicDemo.app / ScriptWriter / CommandGroups / Calculation.cmdgrp (.txt) < prev    next >
Encoding:
NeXT TypedStream Data  |  1993-07-18  |  35.1 KB  |  344 lines

  1. typedstream
  2. CommandGroup
  3. Object
  4. Calculation
  5. Command
  6. NXImage
  7. NXCachedImageRep
  8. NXImageRep
  9. iisssss00
  10. iiiiii00
  11. [4608c]ToUoUoU_eoU_D_V_U_EOT
  12. Uoe_UOeoU_U_U_U_U_U_U_eoUOT_U_U_U_e_U_U_UOT_U_U_UOdoUoUoU_UoE_e_eOd_
  13. UoW_VoV
  14. foeof
  15. V_foVof
  16. VoVoW
  17. WoVoV
  18. fogoe_
  19. eOD/D?3
  20. C/D/C/3
  21. C/D/C/4
  22. D?4/C/D
  23. UoU_Uo
  24. U_UoE_
  25. U_V_U_
  26. V_U_E_
  27. U_V_U_
  28. U_U_V_
  29. U_U_U_
  30. UOU_U_
  31. U_EOe_
  32. UOT_U_
  33. T_U_e_
  34. UOU_UO
  35. TOV_UO
  36. UOTOUO
  37. UoU_T_
  38. U_eoU_
  39. UoU_e_
  40. U_U_U_
  41. U_U_U_V_U_U_U_U_U_U_U_U_U_
  42. fofofoeofofoV_eogofof_fogofoVoeogofoV_v
  43. gofogoeogofofofoV_foVofoVofoVofofofoVo
  44. VoeoVof
  45. foeoVoeofo
  46. foeoVoeoU_eoU_
  47. foeofoe
  48. foeoUof
  49. U_T_fo
  50. Vofof
  51. VoUoVoUoVoU_
  52. U_U_V_U_U_UoU_U_EOU_U_U_U_U_U_UoE_UoU_UoE_UoU_UoE_UoU_UoE_UoU_UoE_UoU_UoU_UoE_UoU_UoV_eo
  53. NXBitmapImageRep
  54. [576c]UUUUUUUUUUU@
  55. iUUUUUUUUUV
  56. FUUUUUUUU{
  57. FL3<0
  58. EEEEEEEEEED
  59. Efefefefef@
  60. UUUUUUUUUUX
  61. 'arbitrary-precision arithmetic language
  62. #{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  63. \margl40
  64. \margr40
  65. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b\i0\ulnone\fs24\fc0\cf0 bc
  66. \b0  is an interactive processor for a language which resembles C but provides unlimited precision arithmetic. It takes input from any files given, then reads the standard input. The -l argument stands for the name of an arbitrary precision math library. The syntax for bc programs is as follows; L means letter a-z, E means expression, S means statement.\
  67. Comments are enclosed in /* and */.\
  68. Names simple variables: L array elements: L [ E ] The words `ibase', `obase', and `scale'\
  69. Other operands arbitrarily long numbers with optional sign and decimal point. ( E ) sqrt ( E ) length ( E ) number of significant decimal digits scale ( E ) number of digits right of decimal point L ( E , ... , E )\
  70. Operators + * / % ^ (% is remainder; ^ is power) ++ -(prefix and postfix; apply to names) == <= >= != < > = += -= *= /= %= ^=\
  71. Statements E \{ S ; ... ; S \} if ( E ) S while ( E ) S for ( E ; E ; E ) S null statement break quit\
  72.  Function definitions define L ( L ,..., L ) \{ auto L, ... , L S; ... S return ( E ) \}\
  73. Functions in -l math library s(x) sine c(x) cosine e(x) exponential l(x) log a(x) arctangent j(n,x) Bessel function\
  74. All function arguments are passed by value.\
  75. The value of a statement that is an expression is printed unless the main operator is an assignment. Either semicolons or newlines may separate statements. Assignment to scale influences the number of digits to be retained on arithmetic operations in the manner of dc(1). Assignments to ibase or obase set the input and output number radix respectively.\
  76. The same letter may be used as an array, a function, and a simple variable simultaneously. All variables are global to the program. `Auto' variables are pushed down during function calls. When using arrays as function arguments or defining them as automatic variables empty square brackets must follow the array name.\
  77. For example\
  78. scale = 20 define e(x)\{ auto a, b, c, i, s a = 1 b = 1 s = 1 for(i=1; 1==1; i++)\{ a = a*x b = b*i c = a/b if(c == 0) return(s) s = s+c \} \}\
  79. defines a function to compute an approximate value of the exponential function and\
  80. for(i=1; i<=10; i++) e(i)\
  81. prints approximate values of the exponential function of the first ten integers.\
  82. Bc is actually a preprocessor for dc(1), which it invokes automatically, unless the -c (compile only) option is present. In this case the dc input is sent to the standard output instead.
  83. CommandOption
  84. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;\f1\fswiss Helvetica;}
  85. \margl40
  86. \margr40
  87. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Compile only
  88. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  89. \margl40
  90. \margr40
  91. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The name of an arbitrary precision math library
  92. CommandArgument
  93. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  94. \margl40
  95. \margr40
  96. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The input for 
  97. \b bc
  98. ToUoUoU_eoU_D_V_U_EOT
  99. Uoe_UOeoU_U_U_U_U_U_U_eoUOT_U_U_U_e_U_U_UOT_U_U_UOdoUoUoU_UoE_e_eOd_
  100. UoW_VoV
  101. foeof
  102. V_foVof
  103. VoVoW
  104. WoVoV
  105. fogoe_
  106. eOD/D?3
  107. C/D/C/3
  108. C/D/C/4
  109. D?4/C/D
  110. UoU_Uo
  111. U_UoE_
  112. U_V_U_
  113. V_U_E_
  114. U_V_U_
  115. U_U_V_
  116. U_U_U_
  117. UOU_U_
  118. U_EOe_
  119. UOT_U_
  120. T_U_e_
  121. UOU_UO
  122. TOV_UO
  123. UOTOUO
  124. UoU_T_
  125. U_eoU_
  126. UoU_e_
  127. U_U_U_
  128. U_U_U_V_U_U_U_U_U_U_U_U_U_
  129. fofofoeofofoV_eogofof_fogofoVoeogofoV_v
  130. gofogoeogofofofoV_foVofoVofoVofofofoVo
  131. VoeoVof
  132. foeoVoeofo
  133. foeoVoeoU_eoU_
  134. foeofoe
  135. foeoUof
  136. U_T_fo
  137. Vofof
  138. VoUoVoUoVoU_
  139. U_U_V_U_U_UoU_U_EOU_U_U_U_U_U_UoE_UoU_UoE_UoU_UoE_UoU_UoE_UoU_UoE_UoU_UoU_UoE_UoU_UoV_eo
  140. UUUUUUUUUUU@
  141. iUUUUUUUUUV
  142. FUUUUUUUU{
  143. FL3<0
  144. EEEEEEEEEED
  145. Efefefefef@
  146. UUUUUUUUUUX
  147. desk calculator
  148. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  149. \margl40
  150. \margr40
  151. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b\i0\ulnone\fs24\fc0\cf0 dc
  152. \b0  is an arbitrary precision arithmetic package. Ordinarily it operates on decimal integers, but one may specify an input base, output base, and a number of fractional digits to be maintained. The overall structure of dc is a stacking (reverse Polish) calculator. If an argument is given, input is taken from that file until its end, then from the standard input. The following constructions are recognized:\
  153. number The value of the number is pushed on the stack. A number is an unbroken string of the digits 0-9. It may be preceded by an underscore _ to input a negative number. Numbers may contain decimal points.\
  154. + / * % ^ The top two values on the stack are added (+), subtracted (-), multiplied (*), divided (/), remaindered (%), or exponentiated (^). The two entries are popped off the stack; the result is pushed on the stack in their place. Any fractional part of an exponent is ignored.\
  155. sx The top of the stack is popped and stored into a register named x, where x may be any character. If the s is capitalized, x is treated as a stack and the value is pushed on it.\
  156. lx The value in register x is pushed on the stack. The register x is not altered. All registers start with zero value. If the l is capitalized, register x is treated as a stack and its top value is popped onto the main stack.\
  157. d The top value on the stack is duplicated.\
  158. p The top value on the stack is printed. The top value remains unchanged. P interprets the top of the stack as an ascii string, removes it, and prints it.\
  159. f All values on the stack and in registers are printed.\
  160. q exits the program. If executing a string, the recursion level is popped by two. If q is capitalized, the top value on the stack is popped and the string execution level is popped by that value.\
  161. x treats the top element of the stack as a character string and executes it as a string of dc commands.\
  162. X replaces the number on the top of the stack with its scale factor.\
  163. [ ... ] puts the bracketed ascii string onto the top of the stack.\
  164. <x >x =x The top two elements of the stack are popped and compared. Register x is executed if they obey the stated relation.\
  165. v replaces the top element on the stack by its square root. Any existing fractional part of the argument is taken into account, but otherwise the scale factor is ignored.\
  166. ! interprets the rest of the line as a UNIX command.\
  167. c All values on the stack are popped.\
  168. i The top value on the stack is popped and used as the number radix for further input. I pushes the input base on the top of the stack.\
  169. o The top value on the stack is popped and used as the number radix for further output.\
  170. O pushes the output base on the top of the stack.\
  171. k the top of the stack is popped, and that value is used as a non-negative scale factor: the appropriate number of places are printed on output, and maintained during multiplication, division, and exponentiation. The interaction of scale factor, input base, and output base will be reasonable if all are changed together.\
  172. z The stack level is pushed onto the stack.\
  173. Z replaces the number on the top of the stack with its length.\
  174. ? A line of input is taken from the input source (usually the terminal) and executed.\
  175. ; : are used by bc for array operations.\
  176. An example which prints the first ten values of n! is\
  177. \b [la1+dsa*pla10>y]sy 0sa1 lyx
  178. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  179. \margl40
  180. \margr40
  181. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The file to take arithmetic input from
  182. UUUUUUUUUUU@
  183. iUUUUUUUUUV
  184. FUUUUUUUU{
  185. FL3<0
  186. EEEEEEEEEED
  187. Efefefefef@
  188. UUUUUUUUUUX
  189. ToUoUoU_eoU_D_V_U_EOT
  190. Uoe_UOeoU_U_U_U_U_U_U_eoUOT_U_U_U_e_U_U_UOT_U_U_UOdoUoUoU_UoE_e_eOd_
  191. UoW_VoV
  192. foeof
  193. V_foVof
  194. VoVoW
  195. WoVoV
  196. fogoe_
  197. eOD/D?3
  198. C/D/C/3
  199. C/D/C/4
  200. D?4/C/D
  201. UoU_Uo
  202. U_UoE_
  203. U_V_U_
  204. V_U_E_
  205. U_V_U_
  206. U_U_V_
  207. U_U_U_
  208. UOU_U_
  209. U_EOe_
  210. UOT_U_
  211. T_U_e_
  212. UOU_UO
  213. TOV_UO
  214. UOTOUO
  215. UoU_T_
  216. U_eoU_
  217. UoU_e_
  218. U_U_U_
  219. U_U_U_V_U_U_U_U_U_U_U_U_U_
  220. fofofoeofofoV_eogofof_fogofoVoeogofoV_v
  221. gofogoeogofofofoV_foVofoVofoVofofofoVo
  222. VoeoVof
  223. foeoVoeofo
  224. foeoVoeoU_eoU_
  225. foeofoe
  226. foeoUof
  227. U_T_fo
  228. Vofof
  229. VoUoVoUoVoU_
  230. U_U_V_U_U_UoU_U_EOU_U_U_U_U_U_UoE_UoU_UoE_UoU_UoE_UoU_UoE_UoU_UoE_UoU_UoU_UoE_UoU_UoV_eo
  231. spline
  232. interpolate smooth curve
  233. ]{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  234. \margl40
  235. \margr40
  236. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b\i0\ulnone\fs24\fc0\cf0 spline
  237. \b0  takes pairs of numbers from the standard input as abcissas and ordinates of a function. It produces a similar set, which is approximately equally spaced and includes the input set, on the standard output. The cubic spline output (R. W. Hamming, Numerical Methods for Scientists and Engineers, 2nd ed., 349ff) has two continuous derivatives, and sufficiently many points to look smooth when plotted, for example by graph(1G).
  238. \{\rtf0\ansi{\fonttbl\f0\fmodern Courier;\f1\fswiss Helvetica;}
  239. \margl40
  240. \margr40
  241. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Supply abscissas automatically (they are missing from the input); spacing is given by the next argument, or is assumed to be 1 if next argument is not a number.
  242. number
  243. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  244. \margl40
  245. \margr40
  246. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The number of spaces
  247. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  248. \margl40
  249. \margr40
  250. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The constant k used in the boundary value computation
  251. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  252. \margl40
  253. \margr40
  254. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The value of k
  255. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  256. \margl40
  257. \margr40
  258. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Space output points so that approximately n intervals occur between the lower and upper x limits. (Default n = 100)
  259. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  260. \margl40
  261. \margr40
  262. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The space between output points
  263. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  264. \margl40
  265. \margr40
  266. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Make output periodic, i.e. match derivatives at ends. First and last input values should normally agree
  267. F{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  268. \margl40
  269. \margr40
  270. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Next 1 (or 2) arguments are lower (and upper) x limits. Normally these limits are calculated from the data. Automatic abcissas start at lower limit (default 0)
  271. lower
  272. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  273. \margl40
  274. \margr40
  275. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The lower limit for abcissas
  276. upper
  277. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  278. \margl40
  279. \margr40
  280. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The upper limit for abcissas
  281. ToUoUoU_eoU_D_V_U_EOT
  282. Uoe_UOeoU_U_U_U_U_U_U_eoUOT_U_U_U_e_U_U_UOT_U_U_UOdoUoUoU_UoE_e_eOd_
  283. UoW_VoV
  284. foeof
  285. V_foVof
  286. VoVoW
  287. WoVoV
  288. fogoe_
  289. eOD/D?3
  290. C/D/C/3
  291. C/D/C/4
  292. D?4/C/D
  293. UoU_Uo
  294. U_UoE_
  295. U_V_U_
  296. V_U_E_
  297. U_V_U_
  298. U_U_V_
  299. U_U_U_
  300. UOU_U_
  301. U_EOe_
  302. UOT_U_
  303. T_U_e_
  304. UOU_UO
  305. TOV_UO
  306. UOTOUO
  307. UoU_T_
  308. U_eoU_
  309. UoU_e_
  310. U_U_U_
  311. U_U_U_V_U_U_U_U_U_U_U_U_U_
  312. fofofoeofofoV_eogofof_fogofoVoeogofoV_v
  313. gofogoeogofofofoV_foVofoVofoVofofofoVo
  314. VoeoVof
  315. foeoVoeofo
  316. foeoVoeoU_eoU_
  317. foeofoe
  318. foeoUof
  319. U_T_fo
  320. Vofof
  321. VoUoVoUoVoU_
  322. U_U_V_U_U_UoU_U_EOU_U_U_U_U_U_UoE_UoU_UoE_UoU_UoE_UoU_UoE_UoU_UoE_UoU_UoU_UoE_UoU_UoV_eo
  323. UUUUUUUUUUU@
  324. iUUUUUUUUUV
  325. FUUUUUUUU{
  326. FL3<0
  327. EEEEEEEEEED
  328. Efefefefef@
  329. UUUUUUUUUUX
  330. units
  331. conversion program
  332. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
  333. \margl40
  334. \margr40
  335. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b\i0\ulnone\fs24\fc0\cf0 units
  336. \b0  converts quantities expressed in various standard scales to their equivalents in other scales. It works interactively in this fashion:\
  337. You have: inch You want: cm * 2.54000e+00 / 3.93701e-01\
  338. A quantity is specified as a multiplicative combination of units optionally preceded by a numeric multiplier. Powers are indicated by suffixed positive integers, division by the usual sign:\
  339. You have: 15 pounds force/in2 You want: atm * 1.02069e+00 / 9.79730e-01\
  340. Units only does multiplicative scale changes. Thus it can convert Kelvin to Rankine, but not Centigrade to Fahrenheit. Most familiar units, abbreviations, and metric prefixes are recognized, together with a generous leavening of exotica and a few constants of nature including:\
  341. pi ratio of circumference to diameter c speed of light e charge on an electron g acceleration of gravity force same as g mole Avogadro's number water pressure head per unit height of water au astronomical unit\
  342. `Pound' is a unit of mass. Compound names are run together, e.g. `lightyear'. British units that differ from their US counterparts are prefixed thus: `brgallon'. Currency is denoted `belgiumfranc', `britainpound', ...\
  343. For a complete list of units, `cat /usr/lib/units'.
  344.